widget: Fix gtk_widget_focus_all for !focusable
authorMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 03:42:02 +0000 (23:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 04:11:04 +0000 (00:11 -0400)
This was a case that wasn't handle properly when
the focus is entering from the outside, in forward
direction.

gtk/gtkwidget.c

index 17e21b8b36af6f1233d496e08861b883d49c0ffb..95639e798029cdcb19452afcfb1946d1b8737c31 100644 (file)
@@ -4982,9 +4982,16 @@ gtk_widget_focus_all (GtkWidget        *widget,
     {
       if (gtk_widget_focus_move (widget, direction))
         return TRUE;
+
+      return gtk_widget_grab_focus (widget);
     }
+  else
+    {
+      if (gtk_widget_grab_focus (widget))
+        return TRUE;
 
-  return gtk_widget_grab_focus (widget);
+      return gtk_widget_focus_move (widget, direction);
+    }
 }
 
 gboolean